/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.dmtrsokolov.viewbean;

import java.io.Serializable;

/**
 *
 * @author Dmitry
 */
public class Good implements Serializable, Cloneable {
    
    private Long id;
    private String name;
    private String description;
    private Double price;
    private Integer count;

    public Good() {
    }

    public Good(Long id, String name, String description, Double price, Integer count) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.price = price;
        this.count = count;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Good other = (Good) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public Object clone() throws CloneNotSupportedException {
        Good another =  (Good)super.clone();
        another.setId(this.getId());
        another.setName(this.getName());
        another.setPrice(this.getPrice());
        another.setDescription(this.getDescription());
        another.setCount(this.getCount());
        return another;
    }
    
    
    
}
